//
//  Config.h
//  DrugProphet
//
//  Created by 左学良 on 16/7/28.
//  Copyright © 2016年 左学良. All rights reserved.
//

#ifndef Config_h
#define Config_h

    #ifdef __OBJC2__



        #ifdef DEBUG
            #define DLog( s, ... ) printf("\n[%s] %s [第%d行] %s\n", __TIME__, __FUNCTION__, __LINE__, [[NSString stringWithFormat:s, ## __VA_ARGS__] UTF8String]);
        #else
            #define DLog( s, ... )
        #endif

        #define kBaseUrl @"http://101.132.112.100:8081/httpService"
        #define aliPayScheme @"YangWifi"
        #define PGY_APPKEY @"16af81414837dff46cec4f47aa63a4c3"


        #define xlRGBA(r,g,b,a) [UIColor colorWithRed:r/255.0f green:g/255.0f blue:b/255.0f alpha:a]
        #define xlRGB(r,g,b) xlRGBA(r,g,b,1.0f)

        #define xlHexColor(hex) [UIColor colorFromHexCode:hex]

        #define xlFont(font) [UIFont systemFontOfSize:font]

        #define xlFontBold(font) [UIFont boldSystemFontOfSize:font]

        #define WeakObj(o) autoreleasepool{} __weak typeof(o) Weak##o = o;
        #define StrongObj(o) autoreleasepool{} __strong typeof(o) Strong##o = Weak##o;

        #define kScreenWidth [UIScreen mainScreen].bounds.size.width
        #define kScreenHeight [UIScreen mainScreen].bounds.size.height

        #define xlLocalizedString(key) NSLocalizedString(key,nil)

        #define IsNull(val, def)        ((val)?val:def)
        #define IsNil(val)              ((val == nil || [val isEqual:@""])?YES:NO)

        #define IPHONE4 SCREEN_HEIGHT==480
        #define IPHONE5 SCREEN_HEIGHT==568
        #define IPHONE6 SCREEN_HEIGHT==667
        #define IPHONE6P SCREEN_HEIGHT==736

        #define IS_IPAD (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
        #define IS_IPHONE (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone)
        #define IS_RETINA ([[UIScreen mainScreen] scale] >= 2.0)

        #define SCREEN_WIDTH ([[UIScreen mainScreen] bounds].size.width)
        #define SCREEN_HEIGHT ([[UIScreen mainScreen] bounds].size.height)
        #define SCREEN_MAX_LENGTH (MAX(SCREEN_WIDTH, SCREEN_HEIGHT))
        #define SCREEN_MIN_LENGTH (MIN(SCREEN_WIDTH, SCREEN_HEIGHT))

        #define IS_IPHONE_4_OR_LESS (IS_IPHONE && SCREEN_MAX_LENGTH < 568.0)
        #define IS_IPHONE_5 (IS_IPHONE && SCREEN_MAX_LENGTH == 568.0)
        #define IS_IPHONE_6 (IS_IPHONE && SCREEN_MAX_LENGTH == 667.0)
        #define IS_IPHONE_6P (IS_IPHONE && SCREEN_MAX_LENGTH == 736.0)
        #define IS_IOS_10 [[[UIDevice currentDevice] systemVersion] floatValue] >= 10.0

        #import "UIView+XLExtension.h"
        #define MAS_SHORTHAND
        #define MAS_SHORTHAND_GLOBALS
        #import "Masonry.h"
        #import "MJExtension.h"
        #import "UIImage+XLExtension.h"
        #import "UIView+XLExtension.h"
        #import "UIViewController+XLExtension.h"
        #import "UIButton+XLExtension.h"
        #import "UIControl+touch.h"
        #import "AFNetworking.h"
        #import "UILabel+XLExtension.h"
        #import "UIImageView+XLNetworking.h"
        #import "XLNavigationVC.h"
        #import "AppDelegate.h"
        #import "UIColor+FlatUI.h"
        #import "MJRefresh.h"
        #import "UICollectionReusableView+XLExtension.h"
        #import "AccountHanler.h"
        #import "MHNetwrok.h"
        #import "UIView+Toast.h"
        #import "XLBaseModel.h"
        #import "NSString+Ext.h"
        #import "CocoaLumberjack.h"

        #ifdef DEBUG
        static const int ddLogLevel = DDLogLevelVerbose;
        #else
        static const int ddLogLevel = DDLogLevelWarning;
        #endif

        typedef NS_ENUM(NSUInteger, PwdType) {
                RegistPwdType,
                ForgotPwdType,
        };
#endif

#endif /* Config_h */
